﻿using J.Model;
using J.ProductSet.Application.Command.CommercialOwnerCommand;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;

namespace J.ProductSet.Controllers
{
    /// <summary>
    /// 商户设置表(写)
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class CommercialOwnerController : ControllerBase
    {
        private readonly IMediator _mediator;
        public CommercialOwnerController(IMediator mediator)
        {
            _mediator = mediator;
        }
        /// <summary>
        /// 商户设置添加
        /// </summary>
        /// <param name="Commercia"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<IActionResult> CommercialOwnerPost(CommercialOwnerPostCommand command)
        {
            return Ok(await _mediator.Send(command));
        }
        /// <summary>
        /// 商户设置批量删除
        /// </summary>
        /// <param name="MerchantID"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<IActionResult> CommercialOwnerDelete(CommercialOwnerDeleteCommand command)
        {
            return Ok(await _mediator.Send(command));
        }
        /// <summary>
        /// 商户设置删除
        /// </summary>
        /// <param name="MerchantID"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<IActionResult> CommercialOwnerDeletion(CommercialOwnerDeletionCommand command)
        {
            return Ok(await _mediator.Send(command));
        }
        /// <summary>
        /// 商户设置修改
        /// </summary>
        /// <param name="Commercia"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<IActionResult> CommercialOwnerUpdate(CommercialOwnerUpdateCommand command)
        {
            return Ok(await _mediator.Send(command));
        }
    }
}
